﻿using Microsoft.EntityFrameworkCore;
using Sgr.Data;
using Sgr.EntityFrameworkCore;
using Sgr.OmniMetrics.Domain;
using Sgr.OmniMetrics.Infrastructure.EntityConfigurations;

namespace Sgr.OmniMetrics.Infrastructure
{
    public class OmniMetricsEntityFrameworkTypeProvider : IEntityFrameworkTypeProvider
    {
        public string Name => "SGR";

        public void RegisterEntities(ModelBuilder modelBuilder, DatabaseType? databaseType)
        {
            // Entity 和 ApplyConfiguration 重复，仅保留 ApplyConfiguration 即可
            //modelBuilder.Entity<OmniMetricEntity>();

            modelBuilder.ApplyConfiguration(new OmniMetricEntityConfiguration(databaseType));
        }
    }
}